package com.rq.rvlibrary;


import android.view.ViewGroup;

import java.util.List;

public abstract class NestingBuilder<Par, Chi> {
    /**
     * @param clazz 默认为 NestingViewHolder ,
     * @param obj   重写clazz需要传入此参数,传入this即可
     * @return
     */
    public NestingBuilder usingInnerClass(Class clazz, Object obj) {
        this.clazz = clazz;
        this.usingInnerClass = obj;
        return this;
    }

    public <VH extends BaseViewHolder> Class<VH> getHolderClazz() {
        return this.clazz;
    }

    public Object usingInnerClass;
    private int outLayoutId;
    private int innerLayoutId;
    private int innerRecyclerId;
    private Class clazz = NestingViewHolder.class;

    public int getOutLayoutId() {
        return outLayoutId;
    }

    public int getInnerLayoutId() {
        return innerLayoutId;
    }

    public int getInnerRecyclerId() {
        return innerRecyclerId;
    }

    public NestingBuilder(int outLayoutId, int innerLayoutId, int innerRecyclerId) {
        this.outLayoutId = outLayoutId;
        this.innerLayoutId = innerLayoutId;
        this.innerRecyclerId = innerRecyclerId;
    }

    public abstract <Par> List getChildData(Par parentBean, int position);

    public <Chi> void fillChildData(EasyViewHolder holder, int position, Chi childBean, int pPostion) {

    }

    public <Par> void fillParentData(BaseViewHolder holder, BaseAdapter parentAdapter, int position, Par parentBean, BaseAdapter childAdapter, boolean showChild) {
    }

    public ViewGroup.LayoutParams getChildLayoutParams(ViewGroup.LayoutParams oldLM) {
        return oldLM;
    }

    public RecyclerUtil getChildRecyclerUtil(BaseAdapter adapter) {
        return null;
    }
}
